// 系统消息列表
<template>
    <div>
        <div class="radioBox">
        <GoBack></GoBack>
        <p class="adselfBox">系统通知</p>
        <!-- 列表Box -->
        <div class="RadioListBox" id='scrollDiv'>
            <div class="Item flex flex-align-center" v-for='(item,index) in RadioList' :key='index'>
                <p class="flex-1">{{item.message}},{{item.title}}。</p><p>{{item.create_time}}</p>
            </div>
        </div>
        </div>
    </div>
</template>
<script>
import GoBack from '../goback'
export default {
    components: {
        GoBack
    },
    mounted () {
        this.getObtainNoticeById();
        this.scroll();
    },
    data () {
        return {
            RadioList:[],
            page:1,
            stup:true,
        }
    },
    methods: {
        getObtainNoticeById(){
            let uid = this.$store.state.userInfo.id;
            this.https('user/getObtainNoticeById',{uid:uid,page:this.page})
            .then(data => {
                    if(data.data.length != ''){
                        for(let i in data.data){
                            this.RadioList.push(data.data[i]);
                        }
                        this.stup = true;
                    }else{
                        this.stup = false;
                    }
            })
        },
        scroll(){
            let _self = this;
            let scrollDiv = document.getElementById('scrollDiv');
            scrollDiv.addEventListener('scroll',function(){
                if(scrollDiv.scrollTop+scrollDiv.clientHeight == scrollDiv.scrollHeight && _self.stup){
                    _self.page ++;
                    _self.getObtainNoticeById();
                }
            })
        }
    },
}
</script>
<style lang="less" scoped>
@import url(../../assets/css/usercenter/radiolist.less);
</style>

